﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="FlotTest.aspx.cs" Inherits="FlotTest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script src="js/excanvas.min.js" type="text/javascript"></script>
    <script src="js/jquery.flot.js" type="text/javascript"></script>
    <script src="js/jquery.flot.patch159.js" type="text/javascript"></script>
    <script src="js/apollo.jqgrid.js" type="text/javascript"></script>
    <script src="js/apollo.chart.js" type="text/javascript"></script>

    <script type="text/javascript">
        // on load page, show graf
        $(function () {
            var chart = new apolloChart($("#flotcontainer"), {
                ajaxUrl: "JSONEntityList.ashx?ViewId=6&f={\"groupOp\":\"and\",\"rules\":[{\"field\":\"IssueDate\",\"op\":\"ge\",\"data\":\"01/01/2011\"}],\"groups\":[]}&c=ContractState,CountDistinct(Id),Month(IssueDate)",


                columnModels: [{ name: 'ContractState', index: 'ContractState', width: 100, fieldType: 'enum', displayName: 'ContractState', aggregate: 'None' }, { name: 'Id', index: 'CountDistinct(Id)', width: 100, fieldType: 'int', displayName: 'CountDistinct(Id)', align: 'right', aggregate: 'CountDistinct' }, { name: 'IssueDate', index: 'Month(IssueDate)', width: 100, fieldType: 'datetime', displayName: 'Month(IssueDate)', align: 'center', formatter: apolloMonth, aggregate: 'Month'}],

                dimensions: ['ContractState'],
                metrics: ['CountDistinct(Id)'],
                tick: 'Month(IssueDate)'
                , legendContainer: $("#flotlegend")
            });
        });

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <table>
        <tr>
            <td valign="top"><div id="flotcontainer" style="width: 600px; height: 400px;"></div></td>
            <td valign="top"><div id="flotlegend"></div></td>
        </tr>
    </table>
    

</asp:Content>

